<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body styleClass="Corpo" style="font-size:13px;">

	<h:form id="formFiltroNApro">

		<div align="center" class="DivCentralizada"
			style="left: 50%; margin-left: -500px;">
			<div align="center"
				style="float: left; padding-right: 3px; padding-top: 4px;">
				<h:outputLabel value="#{message.label_destino}"
					styleClass="LabelFont" style="margin-left:30px;" />
			</div>
			<div align="center" style="float: left; padding-right: 24px;">
				<p:selectOneMenu value="#{gerenciaChamadoTela.destinoChamadoFiltro}"
					effect="fade" style="font-size: 13px;">
					<f:selectItem itemLabel="" itemValue="0" />
					<f:selectItems value="#{gerenciaChamadoTela.destinosFiltro}"
						var="tipo" itemLabel="#{tipo.destinoChamado}"
						itemValue="#{tipo.destinoChamado}" style="font-size: 13px;" />
					<p:ajax global="false" />
				</p:selectOneMenu>
			</div>
			<div align="center"
				style="float: left; padding-right: 3px; padding-top: 4px;">
				<h:outputLabel value="#{message.solicita_solicitante}"
					styleClass="LabelFont" style="margin-left:30px;" />
			</div>
			<div align="center" style="float: left; padding-right: 24px;">
				<p:selectOneMenu value="#{gerenciaChamadoTela.solicitanteFiltro}"
					effect="fade" style="font-size: 13px;">
					<f:selectItem itemLabel="" itemValue="" />
					<f:selectItems value="#{gerenciaChamadoTela.solicitantesFiltro}"
						var="solicitante" itemLabel="#{solicitante.nome}"
						itemValue="#{solicitante.codigo}" style="font-size: 13px;" />
					<p:ajax global="false" />
				</p:selectOneMenu>
			</div>
			<div align="center"
				style="float: left; padding-right: 3px; padding-top: 4px;">
				<h:outputLabel value="#{message.label_num_chamado}"
					styleClass="LabelFont" style="margin-left:30px;" />
			</div>
			<div align="center" style="float: left; padding-right: 24px;">
				<p:inputText converterMessage="#{message.msg_conversao}"
					value="#{gerenciaChamadoTela.numeroChamadoFiltro}" />
			</div>
			<div
				style="margin-top: 5px; padding-left: 12px; padding-right: 24px; float: left; clear: both;">
				<p:commandButton value="#{message.botao_filtrar}"
					icon="ui-icon-search" style="margin-left:30px; font-size: 14px;"
					action="#{gerenciaChamadoTela.filtrarNAprovados}"
					update=":formChNApro,:messages" />
			</div>
		</div>

	</h:form>


	<div align="left" style="padding-left: 3px; padding-top: 8px;">
		<h:form id="formChNApro">
			<p:dataTable var="chamado" id="idTChNAp"
				value="#{gerenciaChamadoTela.chamadosNaoAprovados}"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="10,15,20" rows="10" paginator="true"
				rowKey="#{chamado.codigo}" emptyMessage="#{message.msg_semvalores}">

				<p:column style="width:4%">
					<p:rowToggler />
				</p:column>

				<p:column style="width:10%" sortBy="#{chamado.codigo}">
					<f:facet name="header">  
                    #{message.label_num_chamado} 
            		</f:facet>
					<h:outputText value="#{chamado.codigo}" />
				</p:column>

				<p:column style="width:10%"
					sortBy="#{chamado.tipoProblema.destinoChamado}">
					<f:facet name="header">  
                    #{message.label_destino} 
            		</f:facet>
					<h:outputText value="#{chamado.tipoProblema.destinoChamado}" />
				</p:column>

				<p:column style="width:10%"
					sortBy="#{chamado.tipoProblema.descricao}">
					<f:facet name="header">  
                    #{message.label_assunto} 
            		</f:facet>
					<h:outputText value="#{chamado.tipoProblema.descricao}" />
				</p:column>

				<p:column style="width:10%" sortBy="#{chamado.dataEmissao}">
					<f:facet name="header">  
                    #{message.solicita_dt_emissao } 
            		</f:facet>
					<h:outputText
						value="#{chamadoTela.converteData(chamado.dataEmissao)}" />
				</p:column>

				<p:column style="width:10%" sortBy="#{chamado.usuario.nome}">
					<f:facet name="header">  
                    #{message.solicita_solicitante} 
            		</f:facet>
					<h:outputText value="#{chamado.usuario.nome}" />
				</p:column>

				<p:column style="width:10%">
					<f:facet name="header">  
                    #{message.label_acoes} 
            		</f:facet>

					<p:commandButton id="butApro" styleClass="ButtonPesq"
						oncomplete="dlg14.show()" icon="ui-icon-check"
						actionListener="#{gerenciaChamadoTela.preencheResponsaveis(usuario.tipoChamado)}"
						update=":formAprovaCh:comboResp" style="margin-left: 10px;">
						<f:setPropertyActionListener
							target="#{gerenciaChamadoTela.chamado}" value="#{chamado}" />
					</p:commandButton>

					<p:commandButton id="butTroca" icon="ui-icon-transferthick-e-w"
						styleClass="ButtonPesq" style="margin-left: 10px;"
						oncomplete="dlg15.show()" update=":formAltDes:editaAltDes">
						<f:setPropertyActionListener
							target="#{gerenciaChamadoTela.chamado}" value="#{chamado}" />
					</p:commandButton>

					<p:commandButton id="butNegar" icon="ui-icon-cancel"
						styleClass="ButtonPesq" style="margin-left: 10px;"
						oncomplete="dlg16.show()">
						<f:setPropertyActionListener
							target="#{gerenciaChamadoTela.chamado}" value="#{chamado}" />
					</p:commandButton>

					<p:commandButton id="butHist2" icon="ui-icon-search"
						styleClass="ButtonPesq" style="margin-left: 10px;"
						action="#{gerenciaChamadoTela.preencheHistorico(chamado)}"
						oncomplete="dlgHist.show();" update=":descHist"
						rendered="#{chamado.historicos.size() > 0 ? true : false}" />

					<p:commandButton id="butAnexo2" styleClass="ButtonPesq"
						icon="ui-icon-arrowthickstop-1-s" ajax="false"
						rendered="#{chamado.arquivo != null ? true : false}"
						style="margin-left: 10px;">
						<p:fileDownload value="#{chamadoTela.downloadArquivo(chamado)}" />
					</p:commandButton>

					<p:tooltip for="butApro" value="#{message.label_aprovar}" />
					<p:tooltip for="butTroca" value="#{message.label_trocar_destino}" />
					<p:tooltip for="butNegar" value="#{message.label_negar}" />
					<p:tooltip for="butHist2" value="#{message.label_ver_historico}" />
					<p:tooltip for="butAnexo2" value="#{message.label_anexo}" />

				</p:column>
				<p:rowExpansion>
					<div style="margin-top: 30px;">
						<div style="float: left; padding-left: 8px;">
							<h:panelGrid columns="2" cellpadding="1" style="width:315px;"
								columnClasses="label, value">

								<h:outputText style="font-weight: bold;"
									value="#{message.solicita_filial}" />
									
								<h:outputText
									value="#{chamado.usuario.filial.filial} (#{chamado.usuario.filial.descricao}) " />
								
								<h:outputText style="font-weight: bold;" value="Ramal" />
								
								<h:outputText value="#{chamado.ramal}" />
								
								<h:outputText style="font-weight: bold;"
									value="#{message.label_email}" />

								<h:outputText value="#{chamado.usuario.email}" />

							</h:panelGrid>
						</div>

						<div style="float: left; margin-left: 30px;">
							<h:panelGrid columns="1" cellpadding="1"
								style="width:700px;center;">
								<h:outputText style="font-weight: bold;"
									value="#{message.label_comentario}" />
								<h:outputText escape="false" value="#{chamado.descricao}" />
							</h:panelGrid>
						</div>
					</div>
				</p:rowExpansion>
			</p:dataTable>
		</h:form>
	</div>
</h:body>

</html>
